package cn.com.cifi.mars.service.impl;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.cifi.mars.constant.IsDeleteEnum;
import cn.com.cifi.mars.constant.StageStatusEnum;
import cn.com.cifi.mars.entity.DmDmSupplyConfirmReport;
import cn.com.cifi.mars.entity.DmDmSupplyConfirmReportMonth;
import cn.com.cifi.mars.mapper.mars.DmDmSupplyConfirmReportMapper;
import cn.com.cifi.mars.service.DmDmSupplyConfirmReportService;

/**
 * <p>
 * 供货确认表 服务实现类
 * </p>
 *
 * @author plx
 * @since 2020-07-09
 */
@Service
public class DmDmSupplyConfirmReportServiceImpl extends ServiceImpl<DmDmSupplyConfirmReportMapper, DmDmSupplyConfirmReport> implements DmDmSupplyConfirmReportService {

	@Autowired
	private  DmDmSupplyConfirmReportMapper dmDmSupplyConfirmReportMapper;
	
	@Override
	public List<DmDmSupplyConfirmReport> queryList(String affiliationMonth, List<String> projectIds,String projectName, Integer status) {
		if(CollectionUtils.isEmpty(projectIds)) {
			return null;
		}
		return dmDmSupplyConfirmReportMapper.selectDataList(affiliationMonth,projectIds,projectName,status,StageStatusEnum.CTIVE.getKey(),IsDeleteEnum.NO.getKey());
	}

	@Override
	public List<DmDmSupplyConfirmReportMonth> queryMonthList(String affiliationMonth) {
		return dmDmSupplyConfirmReportMapper.selectMonthList(affiliationMonth);
	}

}
